<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../common/taglib.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>我的首页</title>
	<meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE">
	
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/header.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/common.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/public.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/default.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/footer.css"/>">	
	<script type="text/javascript">
		function searchResume(pageSize,pageNo){
			var form = document.getElementById("searchForm");
			form.pageSize.value=pageSize;
			form.pageNo.value=pageNo;
			form.key.value='${jobSearchModel.key}';
			form.keyword.value='${jobSearchModel.keyword}';
			form.industry.value='${jobSearchModel.industry}';
			form.workplace.value='${jobSearchModel.workplace}';
			form.experience.value='${jobSearchModel.experience}';
			form.lowsalary.value='${jobSearchModel.lowsalary}';
			form.highsalary.value='${jobSearchModel.highsalary}';
			form.submit();
		}
	</script>
  </head>
<body id="home">

<jsp:include page="../common/header.jsp"></jsp:include>

<div class="wrap clearfix">
  <div class="main"> 
	   <div class="feeds-panel">
	   		简单搜索：
	    	<form:form  method="post" modelAttribute="jobSearchModel">
	    		<form:select path="key" >
	    			 <form:option value="企业">企业</form:option>
   					 <form:option value="职位">职位</form:option>
	    		</form:select>
	    		<input type="text" name="keyword" class="text span7" value="${jobSearchModel.keyword}">
	    		<input type="submit" value="搜索" class="btn btn-middle btn-primary">
	    	</form:form>
	    	高级搜索：
	    	<form:form method="post" id="searchForm" modelAttribute="jobSearchModel" >
	    	<input type="hidden" name="pageSize">
	    	<input type="hidden" name="pageNo">
	    		<table >
	    			<tr>
		    			<td>
				    		<form:select path="key" >
				    			<form:option value="企业">企业</form:option>
			   					<form:option value="职位">职位</form:option>
	    					</form:select>
			    		</td>
			    		<td colspan="3"><input type="text" name="keyword" class="text span7" value="${jobSearchModel.keyword}"></td>
		    		</tr>
		    		<tr>
		    			<td>行业:</td>
		    			<td><input type="text" name="industry" class="text span7" value="${jobSearchModel.industry}"></td>
		    			<td>经验:</td>
		    			<td>
		    				<form:select path="experience" >				    			 
			   					 <form:option value="应届">应届</form:option>
			   					 <form:option value="1年">1年</form:option>
			   					 <form:option value="5年">5年</form:option>
			   					 <form:option value="不限">不限</form:option>
				    		</form:select>
		    			</td>
		    		</tr>
		    		<tr>
		    			<td>地区:</td>
		    			<td><input type="text" name="workplace" class="text span7" value="${jobSearchModel.workplace}"></td>
		    			<td colspan="2">
		    				薪水:<input type="number" min="0" name="lowsalary" class="text span3" value="${jobSearchModel.lowsalary}">
		    				-<input type="number" min="0" name="highsalary" class="text span3" value="${jobSearchModel.highsalary}">
		    			</td>
		    		</tr>
		    		<tr>
		    			<td align="center" colspan="4">
		    				<input type="submit" value="搜索" class="btn btn-middle btn-primary" >
		    			</td>
		    		</tr>		    		
	    		</table>
	    	</form:form>
	   </div>
  </div>
  
  <div class="side">
      
   </div>
  	
  
	<div class="main"> 
	   <div class="feeds-panel">
	    <div class="tabs-ui tabs-ui-main">
	      <ul>
	        <li class="current"> 共搜索到x个职位</li>
	      </ul>
	    </div>
	    <div class="feeds">
		<div id="feed-recommendjob-feed-list" class="feed-recommend-job">
	    <div class="feed-list">
	    <c:if test="${jobs!=null }">
	    <c:forEach var="object" items="${ jobs}">
	        <ul>         
	        	<li>
	              <a target="_blank" href="<c:url value="/job/detail/${object[0] }"/>">
	                <h4>
	                  <span class="company-name">${object[1]}</span>                               
					</h4>
	                <dl class="clearfix">
	                  <dt class="salary"><span class="muted">年薪 </span><strong class="text-warning">${object[5]}万</strong></dt>
	                  <dt class="company">${object[2] }</dt>
	                  <dt class="city"><span class="muted">${object[3] }</span></dt>
	                  <dt class="date"><span class="muted">${object[4]}</span></dt>
	                </dl>
	              </a>
	            </li>       
	        </ul>
	      </c:forEach>
	      </c:if>
	      </div>
	      <br>	      
	      <div class="pagerbar">
			  <a href="#" onclick="searchResume(5,${curPage-1})">上页</a>
			  <a href="#" onclick="searchResume(5,1)">1</a>
			  <a href="#" onclick="searchResume(5,2)">2</a>
			  <a href="#" onclick="searchResume(5,3)">3</a>
			  <a href="#" onclick="searchResume(5,4)">4</a>
			  <a href="#" onclick="searchResume(5,5)">5</a>
			  <span class="ellipsis">…</span>
			  <a href="#" onclick="searchResume(5,${curPage+1})">下页</a>		          
		  </div>	      
		</div>
		</div>
	  </div>
	</div>
	
	
</div>

<jsp:include page="../common/footer.jsp"></jsp:include>

</body>
</html>